package com.ruoyi.web.controller.zsix;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.zsix.domain.process.ConditionDto;
import com.ruoyi.zsix.service.IFlowCondService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/flowCond")
public class FlowCondController extends BaseController {
    @Autowired
    private IFlowCondService iFlowCondService;

    /**
     * 获取方向条件设置
     * @param id
     * @return
     */
    @Log(title = "获取方向条件设置" , businessType = BusinessType.EXPORT)
    @GetMapping("/getFlowCond")
    public AjaxResult getFlowCond(@RequestParam("id") String id){
        return success(iFlowCondService.getFlowCond(id));
    }

    /**
     * 设置方向条件
     * @param param
     * @return
     */
    @Log(title = "设置方向条件" , businessType = BusinessType.EXPORT)
    @PostMapping("/setFlowCond")
    public AjaxResult setFlowCond(@RequestBody ConditionDto param){
        return success(iFlowCondService.setFlowCond(param));
    }

    /**
     * 删除方向条件设置
     * @param param
     * @return
     */
    @Log(title = "删除方向条件设置" , businessType = BusinessType.EXPORT)
    @PostMapping("/deleteFlowCond")
    public AjaxResult deleteFlowCond(@RequestBody ConditionDto param){
        return success(iFlowCondService.deleteFlowCond(param));
    }
}
